import { createRouter, createWebHistory } from 'vue-router'

import zhuceView from '@/views/zhuce/index.vue'
import loginView from '@/views/login/index.vue'
import dindanView from '@/views/dindan/index.vue'
import xiangqingView from '@/views/xiangqing/index.vue'
import sousuoView from '@/views/sousuo/index.vue'
import homeView from '@/views/Home/home.vue'
import fenView from '@/views/Home/fen.vue'
import myView from '@/views/Home/my.vue'
import indexView from '@/views/Home/index.vue'
import cartView from '@/views/Home/cart.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/zhuce',
      component: zhuceView,
    },
    {
      path: '/login',
      component: loginView,
    },
    {
      path: '/dindan',
      component: dindanView,
    },
    {
      path: '/xiangqing/:goods_id',
      component: xiangqingView,
    },
    {
      path: '/sousuo',
      component: sousuoView,
    },
    {
      path: '/Home',
      component: homeView,
      children: [
        {
          path: 'cart',
          component: cartView,
        },
        {
          path: 'fen',
          component: fenView,
        },
        {
          path: 'my',
          component: myView,
        },
        {
          path: 'index',
          component: indexView,
        },
      ]
    },
  ],
})

export default router
